package OOP;
        import java.util.Scanner;
public class Zuoye {
    public static void main(String[] args) {
        StringBuilder a=new StringBuilder();
        StringBuffer b=new StringBuffer();
        long nanoTime1 = System.nanoTime();
        for(int i=0;i<1000000;i++){
            a=a.append(1);
        }
        long time1=System.nanoTime()-nanoTime1;
        long nanoTime2 = System.nanoTime();

        for(int i=0;i<1000000;i++){
            b=b.append(1);
        }
        long time2=System.nanoTime()-nanoTime2;
        if(time1>time2){
            System.out.println("StringBuilder更快哟");
        }
        else {
            System.out.println("StringBuffer更快哟");
        }
    }
}
